<template>
    <div class="dialog">
        <el-dialog
            title="编辑回答"
            :visible.sync="ifShowDialog"
        >
            <el-form
                ref="form"
                :model="form"
                label-width="100px"
            >
                <el-form-item
                    label="答案类型"
                >
                    <el-select v-model="form.answerType" style="float: left">
                        <el-option 
                        v-for="(item, index) in answerTypeChoose" 
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>

                <el-form-item
                    v-if="false"
                    label="答案内容"
                >
                    <el-input v-model="form.answerContent" type="textarea"></el-input>
                </el-form-item>

                <el-form-item
                    label="答案内容"
                >
                    <el-input v-model="form.answerContent" placeholder="输入录音的网络地址，可以选择手机录音，然后上传到七牛云，复制外链到此处"></el-input>
                </el-form-item>

                <el-form-item
                    label="获得赏金"
                >
                    <el-input v-model="form.getMoney"></el-input>
                </el-form-item>

                <el-form-item
                    label="浏览人数"
                >
                    <el-input-number
                     v-model="form.lookPeopleNum" 
                     :min="0" 
                     style="float: left"
                     ></el-input-number>
                </el-form-item>

                <el-form-item
                    label="点赞人数"
                >
                    <el-input-number
                     v-model="form.praiseNum" 
                     :min="0" 
                     style="float: left"
                     ></el-input-number>
                </el-form-item>

                <el-form-item
                    label="是否被采纳"
                >
                    <el-select v-model="form.isAccept" style="float:left">
                        <el-option 
                            v-for="(item, index) in booleanChoose"
                            :key="index"
                            :label="item.label"
                            :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>

                <el-form-item
                    label="回答时间"
                >
                    <el-date-picker
                        style="float:left"
                        v-model="form.answerTime"
                        type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" @click="change">修改</el-button>
                    <el-button type="info" @click="cancel">取消</el-button>
                </el-form-item>
            
            </el-form>

        </el-dialog>
    </div>
</template>

<script>
export default {
    name: 'Dialog',
    data () {
        return {
            ifShowDialog: false,
            form: {

            },
            booleanChoose: [{
                label: '是',
                value: true
            }, {
                label: '否',
                value: false
            }],
            answerTypeChoose: [{
                label: '文字类型',
                value: 'text'
            }, {
                label: '语音类型',
                value: 'voice'
            }]
        }
    },
    methods: {
        show () {
            this.ifShowDialog = true;
        },
        change () {
            this.ifShowDialog = false;
        },
        cancel () {
            this.ifShowDialog = false;
        }
    }
}
</script>

<style lang="stylus" scoped>
    .dialog 
        width 100%
   
</style>



